#!/usr/bin/env python
# -*- coding: utf-8 -*-
#coding=utf8

# 本文件由自动工具 proto.py 自动生成，请勿修改
# filename msg5000_csbuf.py
# package ptl

from ptl.base_csbuf import *


# message Req5001
class Req5001:
	def __init__(self):
		self.protoid = 5001
		self.goodsNum = 0
		self.goodsId = 0
		self.id = ""

	def Marshal(writer):
		writer.setUint16(self.goodsNum, 1)
		writer.setUint32(self.goodsId, 2)
		writer.setString(self.id, 3)

	def Unmarshal( reader):
		self.goodsNum = reader.getUint16(1)
		self.goodsId = reader.getUint32(2)
		self.id = reader.getString(3)
# message Resp5001
class Resp5001:
	def __init__(self):
		self.protoid = 5001
		self.status = 0

	def Marshal(writer):
		writer.setUint8(self.status, 1)

	def Unmarshal( reader):
		self.status = reader.getUint8(1)
# message Req5002
class Req5002:
	def __init__(self):
		self.protoid = 5002
		self.id = 0
		self.goodsId = 0
		self.num = 0

	def Marshal(writer):
		writer.setUint64(self.id, 1)
		writer.setUint32(self.goodsId, 2)
		writer.setUint32(self.num, 3)

	def Unmarshal( reader):
		self.id = reader.getUint64(1)
		self.goodsId = reader.getUint32(2)
		self.num = reader.getUint32(3)
# message Resp5002
class Resp5002:
	def __init__(self):
		self.protoid = 5002
		self.status = 0

	def Marshal(writer):
		writer.setUint8(self.status, 1)

	def Unmarshal( reader):
		self.status = reader.getUint8(1)
# message Req5003
class Req5003:
	def __init__(self):
		self.protoid = 5003
		pass

	def Marshal(writer):
		pass

	def Unmarshal( reader):
		pass
# message Resp5003
class Resp5003:
	def __init__(self):
		self.protoid = 5003
		self.value = []

	def Marshal(writer):
		countvalue = len(self.value)
		writer.setArray(countvalue, 1)
		for i in range(countvalue):
			writer.setMessage(0)
			self.value[i].Marshal(writer)
			writer.endSetMessage()

	def Unmarshal( reader):
		for i in range(reader.getArray(1)):
			msg = GoodsInfo() 
			reader.getMessage(0)
			msg.Unmarshal(reader)
			reader.endGetMessage()
			self.value.append(msg)
